import router from './router';
import Vue from 'vue';
/* 全局前置路由守卫 */
router.beforeEach((to, from, next) => {
    let token = localStorage.getItem('token')
    if(to.path!=='/'&&!token){ //没有登陆的情况下跳转到登录页面
        console.log('nologin')
        next({
            name: 'login'
        });
        // return { name: 'login' }

    }else{
        console.log('login')
        next();
    }
});